﻿@using System.Web.Mvc
@using Webdiyer.WebControls.Mvc
@using KXCXW.Web.CommonClass
@model PagedList<kxcxw.Data.Entities.Feedback>
<div id="dvOrders">
    <table>
        <tr>
            <th style="width: 10%">
            ID
            </th>
           @* <th style="width: 10%">
                @Html.CheckBox("checkAll", new { @onclick = "checkAll()" }) 全选
            </th>*@
            <th style="width: 15%">
                用户称呼
            </th>
            <th style="width: 20%">
                联系方式
            </th>
            <th style="width: 15%">
                反馈日期
            </th>
            <th style="width: 25%">
                反馈内容
            </th>
            <th style="width: 15%">
                操作
            </th>
        </tr>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @item.FeedbackId
                </td>
              @*  <td>
                    @Html.CheckBox("checkFb", new { @value = item.FeedbackId });
                </td>*@
                <td>
                    @item.UserName
                </td>
                <td>
                    @item.ContactInfo
                </td>
                <td>
                    @item.CreateDate
                </td>
                <td>
                    @(item.FeedbackContent.Length > 20 ? item.FeedbackContent.Substring(0, 20) + "..." : item.FeedbackContent)
                </td>
                <td class="action">
                    @Html.ActionLink("查看", "Details", new { id = item.FeedbackId }, new { @class = "view", target = "_blank" })
                    @*@Html.ActionLink("修改", "Edit", new { id = item.FeedbackId }, new { @class = "edit", target = "_blank" })*@
                    |
                    @Html.ActionLink("删除", "Delete", null, new { @href ="javascript:void();", @id = item.FeedbackId, @onclick = "deleteFb(this);", @value = item.FeedbackId, @class = "delete" })
                    <a></a>
                </td>
            </tr>
        }
    </table>
</div>
<script type="text/jscript">
    $(function () {

    });

    function deleteFb(obj) {
        if(!confirm("确定删除吗？"))
        {
            return false;
        }
        var url = "@Url.Action("Delete")"; 
        $.getJSON(url, { id: obj.id*1 }, function (data) {
            if(data.status==true)
            {
                alert("删除成功！");
                window.location.href =window.location.href;
            }
        });    
    }//fun
</script>